home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d939.lha / IanUtils / EMenu.34.3.s < prev    next >
Text File  |  1993-12-20  |  3KB  |  148 lines

  1.     Include    Main.i
  2.     var.w    FontSize
  3.     var.w    FontXSize,FontYSize
  4. Vars_SIZEOF    rs.w    0
  5.  
  6. ;    Version 34.3 - 2/23/92 Ian Einman
  7.  
  8.     lea    Main.text(PC),a0
  9.     pea    Start(pc)
  10. WriteIt    move.l    StdOutput(a5),d1
  11.     move.l    a0,d2
  12. .findend    tst.b    (a0)+
  13.     bne.s    .findend
  14.     move.l    a0,d3
  15.     sub.l    d2,d3
  16.     subq    #1,d3
  17.     Call    Dos,Write
  18.     rts
  19.  
  20. NoInst    lea    NoInst.text(pc),a0
  21.     bra.s    WriteIt
  22. Got1.4plus    bsr.s    NoInst
  23.     lea    Got1.4.text(PC),A0
  24.     bra.s    WriteIt
  25. Got1.0or1    bsr.s    NoInst
  26.     lea    Got1.1.text(PC),A0
  27.     bra.s    WriteIt
  28. NoWB    bsr.s    NoInst
  29.     lea    NoWB.text(PC),A0
  30.     bra.s    WriteIt
  31.  
  32. Start    OpenLib    Intuition
  33.     move.l    Base_Intuition(a5),a6
  34.     move.w    LIB_VERSION(a6),d0
  35.     cmp.w    #34,d0
  36.     bgt.s    Got1.4plus
  37.     cmp.w    #33,d0
  38.     blt.s    Got1.0or1
  39.  
  40.     Call    Intuition,OpenWorkBench
  41.     move.l    sc_FirstWindow(a0),a0
  42.  
  43. WBWindowFind    btst    #1,wd_Flags(a0)
  44.     bne.s    WindowFound
  45.     move.l    (a0),d0
  46.     beq.s    NoWB
  47.     move.l    d0,a0
  48.     bra.s    WBWindowFind
  49.  
  50. WindowFound    move.l    wd_RPort(a0),a2
  51.     move.l    rp_Font(a2),a2
  52.     move.w    tf_YSize(a2),FontYSize(a5)
  53.     move.w    tf_XSize(a2),FontXSize(a5)
  54.     move.w    d5,FontSize(a5)
  55.  
  56.     lea    wd_MenuStrip(a0),a3
  57.  
  58.     move.w    #300,d7
  59. Check4Menu    move.l    (a3),d0
  60.     bne.s    MenuThere
  61.     moveq    #10,d1
  62.     Call    Dos,Delay
  63.     dbf    d7,Check4Menu
  64.     bra    NoWB
  65.  
  66. MenuThere    move.l    d0,a1
  67.  
  68.     lea    MenuData(pc),A0
  69.     move.w    (a0)+,d1        Y Position
  70.     move.w    FontXSize(a5),d5
  71.  
  72.     bsr.s    MenuChange
  73.     bsr.s    MenuChange
  74.     bsr.s    MenuChange    
  75.  
  76.     movem.l    (a0)+,d0-d1
  77.     movem.w    (a0)+,d3/d6-d7
  78.  
  79.     moveq    #6,d2
  80.     bsr.s    ChangeItems
  81.     moveq    #2,d2
  82.     bsr.s    ChangeItems
  83.     moveq    #5,d2
  84.     bsr.s    ChangeItems
  85.  
  86. Installed    lea    Inst.text(PC),A0
  87.     bra    WriteIt
  88.  
  89. MenuChange    movem.w    (a0)+,d0/d2/d7
  90.     mulu.w    d5,d0
  91.     mulu.w    d5,d2
  92.     mulu.w    d5,d7
  93.     movem.w    d0-d2/d6,mu_LeftEdge(a1)
  94.     move.w    d7,mu_BeatX(a1)        Item Width    = D5
  95.     lea    mu_SIZEOF(a1),a1
  96.     rts
  97.  
  98. ;------------------------------------------------------------------------
  99.  
  100. ChangeItems    moveq    #0,d4    Set YPos to zero
  101.     move.b    (a0)+,d5    Get Width (number of chars)
  102.     mulu.w    FontXSize(a5),d5    Fix Width (number of pixels)
  103.     addq    #4,d5    Give 4 more pixels
  104.  
  105.     subq    #1,d2
  106.     move.w    d2,-(a7)
  107.  
  108. ChangeMI    movem.w    d3-d7,mi_LeftEdge(a1)
  109.     move.b    (A0)+,mi_Command(a1)
  110.     add.w    d6,d4    Increment Y-Position
  111.     lea    mi_SIZEOF(a1),a1    Increment Address
  112.     dbf    d2,ChangeMI
  113.  
  114.     move.w    (a7)+,d2
  115. ChangeMT    movem.l    d0-d1,(a1)    TextData
  116.     lea    it_SIZEOF(a1),a1    Increment Address
  117.     dbf    d2,ChangeMT
  118.     rts
  119.  
  120. ;-----------------------------------------------------------------------
  121.  
  122. MenuData    DC.W    $0000    Y-Position    D1
  123.  
  124. MenuData2    DC.W    $01,$0C,$12    D0/D2/D7
  125.     DC.W    $0F,$07,$14    ditto
  126.     DC.W    $18,$0A,$13    ditto
  127.  
  128. TextData    DC.B    $00,$01,$01    Colors, Mode        D0
  129.     EVEN
  130.     DC.W    $0008,$0001    X-Position, Y-Position    D1
  131.     
  132. ItemData    DC.W    $0000    X-Position    D3
  133.     DC.W    $000A    Height    D6
  134.     DC.W    $0056    Flags    D7
  135.  
  136.     DC.B    $11,"OWCRIX"
  137.     DC.B    $13,"TF"
  138.     DC.B    $12,"KEDSV"
  139.     EVEN
  140.  
  141. Main.text    DC.B    "EMenu 34.3 ©1992 Ian Einman - ",0
  142.  
  143. Inst.text    DC.B    "EMenu installed.",10,0
  144. NoInst.text    DC.B    "EMenu not installed.",10,0
  145. Got1.4.text    DC.B    10,27,"[3mWorkbench 1.4 and above do not require ",27,"[1mEMenu.",27,"[0m",10,10,0
  146. Got1.1.text    DC.B    10,27,"[3mWorkbench 1.1 and below not sufficient to run ",27,"[1mEMenu.",27,"[0m",10,10,0
  147. NoWB.text    DC.B    10,27,"[3mWorkbench must be loaded before ",27,"[1mEMenu ",27,"[0m",27,"[3mcan be installed.",27,"[0m",10,10,0
  148.